package com.nommon.tool;

import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;

public class Button extends BasicUIElement {

	private String text;

	public Button(int x, int y, int w, int h, String text) {
		super(x, y, w, h);
		this.text = text;
	}

	@Override
	public void draw(Canvas canvas, int parentX, int parentY) {
		RectF r = CanvasTool.pctToScr(getX()+parentX, getY()+parentY, getWidth(), getHight(), canvas);
		Paint p = new Paint();
		p.setARGB(255, 255, 64, 64);
		android.util.Log.e("", r.left+"|"+r.top+"|"+r.right+"|"+r.bottom);
		canvas.drawRect(r, p);
		p.setARGB(255, 255, 255, 255);
		canvas.drawText(text, r.left, r.bottom, p);
	}



}
